package com.avenger.controller;

import com.avenger.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: BootStrapDemo
 * @description: User operators
 * @author: guanshilong
 * @create: 2019-04-29 08:54
 **/
@RestController
public class UserController {
    @Autowired
    UserService userService;
    @RequestMapping("/add/{name}/{password}")
    @ResponseBody
    public String addUser(@PathVariable String name, @PathVariable String password){
        System.out.println(name + " " + password);
        userService.addUser(name, password);
        return "successful";
    }
}
